<template>
    <h1>这是一个vuex</h1>
    <p>const:{{ count }}</p>
    <button @click="updateCount">修改count</button>

</template>

<script setup>

import { computed } from "vue";
import { useStore } from "vuex";

// 获得实例化对象
const store = useStore()

const count = computed(() => store.state.count)
//触发mutation
const updateCount = () => {
    store.commit ("increment",{ count:520})
}



</script>